package com.ruoqing.oss.factory;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;

/**
	* @author YaoXian
	* @title: OssClientFactory
	* @projectName ruoxi-blog
	* @description: 若兮微服务 - 初始化OssClient对象工厂
	* @date 2020-12-29 23:56
	*/
@RefreshScope
public class OssClientFactory {
		/**
			* 成都地区阿里云OSS端点
			*/
		@Value("${oss.endpoint}")
		private static String endpoint;
		
		/**
			* 阿里云RAM账号秘钥ID
			*/
		@Value("${oss.accessKeyId}")
		private static String accessKeyId;
		
		/**
			* 阿里云RAM账号秘钥
			*/
		@Value("${oss.accessKeySecret}")
		private static String accessKeySecret;
		
		public static OSS createOssClient(){
				return new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
		}
}
